package com.cq.service.impl;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cq.dao.DeptDao;
import com.cq.entity.Dept;
import com.cq.service.DeptService;

import org.springframework.stereotype.Service;

import javax.annotation.Resource;


/**
 * @author C-Q
 * @version 1.1.0
 * @Description: TODO
 * @date 2022/11/17
 */
@Service
public class DeptServiceImpl implements DeptService {
    @Resource
    private DeptDao deptDao;
    @Override
    public Page<Dept> findByPage(int current, Integer pageSize) {
        Page<Dept> page = new Page<>(1,2);
        Page<Dept> all= deptDao.selectPage(page,null);
        return all;
    }

    @Override
    public int delete(Integer DEPTNO) {
     int de=deptDao.deleteById(20);
      return de;
    }

    @Override
    public int updateSer(Dept dept) {
        int up=deptDao.updateById(dept);
        return up;
    }

    @Override
    public int insertDept(Dept dept) {
        int ins=deptDao.insert(dept);
        return ins;
    }

}
